```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lock4j - 高性能分布式锁框架</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .feature-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1rem;
        }
        .code-block {
            background: #f8f8f8;
            border-radius: 8px;
            padding: 1.5rem;
            font-family: 'Courier New', Courier, monospace;
            position: relative;
        }
        .code-block .lang {
            position: absolute;
            top: 0;
            right: 0;
            background: #e2e8f0;
            padding: 0.25rem 0.75rem;
            border-bottom-left-radius: 8px;
            font-size: 0.75rem;
            color: #4a5568;
        }
        .tab-active {
            border-bottom: 2px solid #6e8efb;
            color: #6e8efb;
            font-weight: 500;
        }
        .mermaid {
            background: white;
            padding: 1.5rem;
            border-radius: 8px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
        .footer-link:hover {
            color: #a777e3;
        }
        .problem-item {
            transition: all 0.3s ease;
        }
        .problem-item:hover {
            background-color: #f8f9fa;
            transform: translateX(5px);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6 max-w-5xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl lg:text-5xl font-bold mb-4">分布式锁框架 Lock4j</h1>
                    <p class="text-xl mb-8 opacity-90">高性能分布式锁解决方案，为你的应用保驾护航</p>
                    <div class="bg-white bg-opacity-20 p-6 rounded-xl mb-8">
                        <p class="font-medium mb-4">你是否也经历过这些噩梦般的场景？</p>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-exclamation-circle mr-2 mt-1 text-yellow-300"></i>
                                <span>Redis集群抖动，锁意外失效，数据一致性彻底崩溃</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-exclamation-circle mr-2 mt-1 text-yellow-300"></i>
                                <span>ZooKeeper锁竞争激烈，高并发下性能断崖式下跌</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-exclamation-circle mr-2 mt-1 text-yellow-300"></i>
                                <span>数据库行锁导致线程阻塞，系统吞吐量直接腰斩</span>
                            </li>
                        </ul>
                    </div>
                    <div class="flex space-x-4">
                        <a href="#features" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-opacity-90 transition duration-300">
                            了解更多
                        </a>
                        <a href="#get-started" class="border-2 border-white text-white px-6 py-3 rounded-lg font-medium hover:bg-white hover:bg-opacity-20 transition duration-300">
                            快速开始
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1744265057966-130b9266-ab96-4046-b66a-462c96ccff09.png" alt="Lock4j 架构图" class="rounded-xl shadow-2xl max-w-full h-auto">
                </div>
            </div>
        </div>
    </section>

    <!-- Features Section -->
    <section id="features" class="py-20 bg-white">
        <div class="container mx-auto px-6 max-w-5xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">Lock4j来了！</h2>
                <p class="text-lg text-gray-600 max-w-2xl mx-auto">国产框架，用"三无"设计颠覆传统</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-16">
                <div class="bg-gray-50 p-8 rounded-xl card-hover">
                    <div class="feature-icon bg-indigo-100 text-indigo-600">
                        <i class="fas fa-bolt text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">5ms极速响应</h3>
                    <p class="text-gray-600">2000QPS下仍保持毫秒级延迟，为高并发场景提供稳定支持。</p>
                </div>
                <div class="bg-gray-50 p-8 rounded-xl card-hover">
                    <div class="feature-icon bg-purple-100 text-purple-600">
                        <i class="fas fa-check-circle text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">100%锁保持率</h3>
                    <p class="text-gray-600">网络分区时自动切换本地锁，确保系统高可用性。</p>
                </div>
            </div>
            
            <div class="bg-indigo-50 border-l-4 border-indigo-500 p-6 rounded-lg">
                <div class="flex items-start">
                    <div class="flex-shrink-0">
                        <i class="fas fa-flask text-indigo-500 text-xl mr-3 mt-1"></i>
                    </div>
                    <div>
                        <h4 class="font-bold text-lg mb-2">我们实测对比</h4>
                        <ul class="space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                                <span>接入成本低至5分钟，注解驱动零改造</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-green-500 mr-2 mt-1"></i>
                                <span>生产环境稳定运行2年零故障</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-20 bg-gray-50">
        <div class="container mx-auto px-6 max-w-5xl">
            <div class="mb-16">
                <h2 class="text-3xl font-bold mb-6">1. Lock4j基本介绍</h2>
                
                <h3 class="text-2xl font-semibold mb-4 text-gray-800">1.1 Lock4j的背景与发展历程</h3>
                <p class="text-gray-700 mb-6">Lock4j是一个轻量级的分布式锁框架，旨在解决传统分布式锁在高并发场景下的性能问题。它的设计理念是简化分布式锁的使用，降低开发者的学习成本。Lock4j的开发团队在多年的分布式系统实践中，积累了丰富的经验，最终形成了这一框架。</p>
                
                <h3 class="text-2xl font-semibold mb-4 text-gray-800">1.2 主要特性与优势</h3>
                <div class="grid md:grid-cols-2 gap-6 mb-6">
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">零外部依赖</h4>
                        <p class="text-gray-600">Lock4j不依赖于任何外部中间件，简化了部署和运维。</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">零学习成本</h4>
                        <p class="text-gray-600">通过简单的注解方式，开发者可以快速上手。</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">高性能</h4>
                        <p class="text-gray-600">在高并发场景下，Lock4j能够保持低延迟的锁获取时间。</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">高可用性</h4>
                        <p class="text-gray-600">内置的故障转移机制确保了锁的可靠性。</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Architecture Section -->
    <section class="py-20 bg-white">
        <div class="container mx-auto px-6 max-w-5xl">
            <h2 class="text-3xl font-bold mb-12">2. Lock4j核心架构解析</h2>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">2.1 三层锁模型图解</h3>
                <div class="mermaid mb-8">
                    graph TD
                        A[客户端] --> B[JVM锁]
                        A --> C[进程锁]
                        A --> D[集群锁]
                        B --> E[ConcurrentHashMap]
                        C --> F[进程间共享存储]
                        D --> G[Redis/ZooKeeper]
                </div>
                <div class="code-block">
                    <div class="lang">Java</div>
                    <pre><code>public class LockHierarchy {
    // 第一层：JVM锁
    private static final ConcurrentHashMap&lt;String, ReentrantLock&gt; jvmLocks = new ConcurrentHashMap&lt;&gt;();
    
    // 第二层：进程锁
    @Lock(key = "process:${processId}", fallback = "jvmLock")
    public void processLock() {}
    
    // 第三层：集群锁
    @Lock(key = "cluster:${key}", provider = "redisLockProvider")
    public void clusterLock() {}
}</code></pre>
                </div>
            </div>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">2.2 独创的锁心跳机制</h3>
                <p class="text-gray-700 mb-6">Lock4j引入了锁心跳机制，通过定期续约来保持锁的有效性。这一机制有效避免了因网络波动导致的锁失效问题。</p>
                <div class="code-block">
                    <div class="lang">Java</div>
                    <pre><code>public class LockHeartbeat {
    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    
    public void startHeartbeat(String lockKey) {
        scheduler.scheduleAtFixedRate(() -> {
            try {
                renewLock(lockKey);
            } catch (Exception e) {
                log.error("Lock renewal failed", e);
            }
        }, 0, HEARTBEAT_PERIOD, TimeUnit.MILLISECONDS);
    }
}</code></pre>
                </div>
            </div>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">2.3 锁存储引擎可插拔架构</h3>
                <p class="text-gray-700 mb-6">Lock4j的存储引擎采用可插拔架构，开发者可以根据需求选择不同的锁存储实现。内置的LocalLockProvider提供了简单的本地锁实现。</p>
                <div class="code-block">
                    <div class="lang">Java</div>
                    <pre><code>public class LocalLockProvider implements LockProvider {
    private final ConcurrentHashMap&lt;String, Lock&gt; locks = new ConcurrentHashMap&lt;&gt;();
    
    @Override
    public Lock getLock(String key) {
        return locks.computeIfAbsent(key, k -> new ReentrantLock());
    }
}</code></pre>
                </div>
            </div>
        </div>
    </section>

    <!-- Performance Section -->
    <section class="py-20 bg-gray-50">
        <div class="container mx-auto px-6 max-w-5xl">
            <h2 class="text-3xl font-bold mb-12">3. 性能对比实验：Lock4j vs 主流方案</h2>
            
            <div class="mb-12">
                <h3 class="text-2xl font-semibold mb-4 text-gray-800">3.1 实验环境说明</h3>
                <p class="text-gray-700 mb-6">本次实验在Kubernetes集群中进行，使用JMeter作为压力测试工具，模拟高并发场景。</p>
            </div>
            
            <div class="mb-12">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">3.2 关键指标对比表格</h3>
                <div class="overflow-x-auto bg-white rounded-lg shadow-sm">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">框架</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">TPS</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">平均延迟</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">99th延迟</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">故障恢复时间</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-indigo-600">Lock4j</td>
                                <td class="px-6 py-4 whitespace-nowrap">2000+</td>
                                <td class="px-6 py-4 whitespace-nowrap">5ms</td>
                                <td class="px-6 py-4 whitespace-nowrap">15ms</td>
                                <td class="px-6 py-4 whitespace-nowrap">3s</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap">Redisson</td>
                                <td class="px-6 py-4 whitespace-nowrap">1500+</td>
                                <td class="px-6 py-4 whitespace-nowrap">8ms</td>
                                <td class="px-6 py-4 whitespace-nowrap">25ms</td>
                                <td class="px-6 py-4 whitespace-nowrap">5s</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap">ZooKeeper</td>
                                <td class="px-6 py-4 whitespace-nowrap">800+</td>
                                <td class="px-6 py-4 whitespace-nowrap">12ms</td>
                                <td class="px-6 py-4 whitespace-nowrap">35ms</td>
                                <td class="px-6 py-4 whitespace-nowrap">8s</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            
            <div>
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">3.3 Redis网络分区场景下的锁保持率测试</h3>
                <p class="text-gray-700">在网络分区的情况下，Lock4j的锁保持率显著高于Redis和ZooKeeper，确保了系统的高可用性。</p>
            </div>
        </div>
    </section>

    <!-- Integration Section -->
    <section id="get-started" class="py-20 bg-white">
        <div class="container mx-auto px-6 max-w-5xl">
            <h2 class="text-3xl font-bold mb-12">4. Lock4j和SpringBoot整合</h2>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">4.1 SpringBoot项目中如何集成Lock4j</h3>
                <p class="text-gray-700 mb-6">在SpringBoot项目中集成Lock4j非常简单，只需添加相应的依赖并进行配置。</p>
                <div class="code-block">
                    <div class="lang">XML</div>
                    <pre><code>&lt;!-- Maven依赖 --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;com.baomidou&lt;/groupId&gt;
    &lt;artifactId&gt;lock4j-spring-boot-starter&lt;/artifactId&gt;
    &lt;version&gt;2.2.3&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
                </div>
            </div>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">4.2 实际应用中的配置与使用示例</h3>
                <p class="text-gray-700 mb-6">在SpringBoot应用中，可以通过注解的方式轻松实现分布式锁。</p>
                <div class="code-block">
                    <div class="lang">Java</div>
                    <pre><code>@RestController
public class OrderController {
    
    @Lock(key = "'order:submit:' + #orderDto.userId", expire = 5000)
    @PostMapping("/submit")
    public Result submitOrder(@RequestBody OrderDTO orderDto) {
        // 业务逻辑
        return Result.success("订单提交成功");
    }
}</code></pre>
                </div>
            </div>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">4.3 Lock4j锁在配置示例中的执行过程</h3>
                <p class="text-gray-700 mb-6">当请求到达<code>/submit</code>端点时，Lock4j会尝试获取锁。如果成功，业务逻辑将被执行；如果锁被其他请求持有，则当前请求将被阻塞，直到锁被释放。</p>
            </div>
            
            <div>
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">4.4 Lock4j锁在配置实例的原理</h3>
                <div class="bg-gray-50 p-6 rounded-lg">
                    <div class="grid md:grid-cols-2 gap-8">
                        <div>
                            <h4 class="font-medium text-lg mb-3 text-indigo-600">锁的获取</h4>
                            <p class="text-gray-600 mb-4">当一个请求到达需要加锁的方法时，Lock4j会根据<code>@Lock</code>注解中定义的锁键尝试获取锁。</p>
                            
                            <h4 class="font-medium text-lg mb-3 text-indigo-600">锁的存储</h4>
                            <p class="text-gray-600 mb-4">Lock4j支持多种存储引擎，最常用的是内存存储和Redis等外部存储。</p>
                            
                            <h4 class="font-medium text-lg mb-3 text-indigo-600">锁的过期机制</h4>
                            <p class="text-gray-600">为了防止死锁，Lock4j实现了锁的过期机制。</p>
                        </div>
                        <div>
                            <h4 class="font-medium text-lg mb-3 text-indigo-600">锁的续约机制</h4>
                            <p class="text-gray-600 mb-4">在某些情况下，业务逻辑的执行时间可能超过锁的过期时间。为了解决这个问题，Lock4j引入了锁的续约机制。</p>
                            
                            <h4 class="font-medium text-lg mb-3 text-indigo-600">锁的释放</h4>
                            <p class="text-gray-600">当业务逻辑执行完毕后，Lock4j会自动释放锁。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Implementation Section -->
    <section class="py-20 bg-gray-50">
        <div class="container mx-auto px-6 max-w-5xl">
            <h2 class="text-3xl font-bold mb-12">5. Lock4j实现分布式锁</h2>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">5.1 实际应用中的配置与使用示例</h3>
                <p class="text-gray-700 mb-6">在分布式环境中，Lock4j可以通过Redis等外部存储实现分布式锁。</p>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="code-block">
                        <div class="lang">YAML</div>
                        <pre><code>lock4j:
  provider:
    type: redis
    redis:
      host: localhost
      port: 6379</code></pre>
                    </div>
                    <div class="code-block">
                        <div class="lang">Java</div>
                        <pre><code>@Lock(key = "'order:submit:' + #orderDto.userId", expire = 5000)
public Result submitOrder(@RequestBody OrderDTO orderDto) {
    // 业务逻辑
}</code></pre>
                    </div>
                </div>
            </div>
            
            <div>
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">5.2 Lock4j实现分布式锁的执行过程</h3>
                <p class="text-gray-700">在分布式环境中，Lock4j通过外部存储系统管理锁的状态，确保同一时刻只有一个节点能够持有锁。</p>
            </div>
        </div>
    </section>

    <!-- Annotation Section -->
    <section class="py-20 bg-white">
        <div class="container mx-auto px-6 max-w-5xl">
            <h2 class="text-3xl font-bold mb-12">6. 注解驱动开发实战</h2>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">6.1 <code>@Lock</code>注解的六种玩法</h3>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="bg-gray-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">1. 基本用法</h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'order:' + #orderId")
public void lockMethod(String orderId) { ... }</code></pre>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">2. 设置过期时间</h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'order:' + #orderId", expire = 3000)
public void lockWithExpire(String orderId) { ... }</code></pre>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">3. 防重试锁</h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'order:' + #orderId", retry = false)
public void noRetryLock(String orderId) { ... }</code></pre>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">4. 可重入锁</h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'order:' + #orderId", reentrant = true)
public void reentrantLock(String orderId) { ... }</code></pre>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">5. 动态锁键</h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'order:' + #orderDto.userId + ':' + #orderDto.orderId")
public void dynamicKeyLock(OrderDTO orderDto) { ... }</code></pre>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">6. 使用自定义锁提供者</h4>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'customLock:' + #key", provider = "customLockProvider")
public void customLockMethod(String key) { ... }</code></pre>
                        </div>
                    </div>
                </div>
            </div>
            
            <div>
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">6.2 防重试锁与可重入锁的配置示例</h3>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="bg-indigo-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-indigo-600">防重试锁</h4>
                        <p class="text-gray-600 mb-4">适用于需要确保操作唯一性的场景，如订单提交。</p>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'order:submit:' + #orderId", retry = false)
public void submitOrder(String orderId) { ... }</code></pre>
                        </div>
                    </div>
                    <div class="bg-purple-50 p-6 rounded-lg">
                        <h4 class="font-medium text-lg mb-3 text-purple-600">可重入锁</h4>
                        <p class="text-gray-600 mb-4">适用于需要在同一线程中多次调用的场景，如递归调用。</p>
                        <div class="code-block">
                            <div class="lang">Java</div>
                            <pre><code>@Lock(key = "'recursive:' + #key", reentrant = true)
public void recursiveMethod(String key, int count) {
    if (count > 0) {
        recursiveMethod(key, count - 1);
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- FAQ Section -->
    <section class="py-20 bg-gray-50">
        <div class="container mx-auto px-6 max-w-5xl">
            <h2 class="text-3xl font-bold mb-12">7. 常见问题</h2>
            
            <div class="mb-16">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">7.1 Lock4j的使用建议与注意事项</h3>
                <div class="bg-white p-6 rounded-lg shadow-sm">
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-3 mt-1">
                                <i class="fas fa-info-circle text-sm"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-lg mb-1">合理设置锁超时时间</h4>
                                <p class="text-gray-600">避免锁持有时间过长导致的死锁问题，根据业务逻辑合理设置expire参数。</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-3 mt-1">
                                <i class="fas fa-info-circle text-sm"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-lg mb-1">使用业务唯一标识作为锁键</h4>
                                <p class="text-gray-600">确保锁键的唯一性，避免不同业务场景使用相同锁键导致的冲突。</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-3 mt-1">
                                <i class="fas fa-info-circle text-sm"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-lg mb-1">考虑添加降级策略</h4>
                                <p class="text-gray-600">在高并发场景下，可以考虑实现降级策略，如排队机制或快速失败。</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            
            <div>
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">7.2 常见故障及其解决方案</h3>
                <div class="bg-white p-6 rounded-lg shadow-sm">
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 bg-red-100 rounded-full flex items-center justify-center text-red-600 mr-3 mt-1">
                                <i class="fas fa-exclamation-triangle text-sm"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-lg mb-1">锁失效</h4>
                                <p class="text-gray-600">检查网络连接和心跳机制是否正常，确保锁能够被正确续约。</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 bg-red-100 rounded-full flex items-center justify-center text-red-600 mr-3 mt-1">
                                <i class="fas fa-exclamation-triangle text-sm"></i>
                            </div>
                            <div>
                                <h4 class="font-medium text-lg mb-1">性能瓶颈</h4>
                                <p class="text-gray-600">优化锁的粒度，避免锁竞争过于激烈，可以考虑使用分段锁或读写锁。</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-12">
        <div class="container mx-auto px-6 max-w-5xl">
            <div class="flex flex-col items-center">
                <div class="mb-4">
                    <p class="text-xl font-medium">技术小馆</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="footer-link text-gray-300 hover:text-white transition duration-300">http://www.yuque.com/jtostring</a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```